import { request } from "@/utils"

export function getChannelApi(){
  return request({
    url:'/channels',
    method:'GET',
  })
}

export function createArticleApi(data){
  return request({
    url:'/mp/articles?draft=false',
    method:'POST',
    data
  })
}

export function getArticleListApi(data){
  return request({
    url:'/mp/articles',
    method:'GET',
    params:data
  })
}

export function delArticleListApi(id){
  return request({
    url:`/mp/articles/${id}`,
    method:'DELETE',
  })
}

export function getArticleListByIdApi(id){
  return request({
    url:`/mp/articles/${id}`,
    method:'GET',
  })
}

export function editArticleApi(data){
  return request({
    url:`/mp/articles/${data.id}?draft=false`,
    method:'PUT',
    data
  })
}